<extend name="Public/base"/>
<block name="body">
	<div class="page-header">
		<h2>{$meta_title}</h2>
	</div>
    <div class="container">


    <div class="row">
        <div class="span12">
            <div class="row">
                <div class="span12">
                    <input type="text" name="name" value=""/>  <span id="createGroup" class="btn btn-danger" >新增标签</span>
                    <span id="refreshTag" class="btn btn-primary ajax-get">刷新标签</span>
                    <span class="show-add-message"></span>
                </div>
            </div>
        </div>
    </div>
    <div class="row" style="margin-top: 15px">
        <div class="span12">
            <div class="row" style="padding:15px 0">
                <volist name="_Tags" id="tag">
                    <div class="tags span2">
                        <div class="tag"><a href="{:U('index',array('tag'=>$tag['id']))}">{$tag.name}</a><span class="badge <neq name="tag['count']" value="0"> badge-warning </neq> ">{$tag.count}</span></div>
                    </div>
                </volist>
            </div>
        </div>

        </div>
  <!-- 分页 -->
    <div class="row page">
        {$_page}
    </div>
    </div>
</block>

<block name="script">
    <script>
        $("#createGroup").click(function(){
            var groupName = $(this).prev().val();
            $.post('{:U()}',
                    {
                        act:'create',
                        name:groupName
                    },
                    function(data){
                        alert(data.info)
                    }
            );
        });
        $("#refreshTag").click(function(){
            $.post('{:U()}',
                    {
                        act:'refreshTag'
                    },
                    function(data){
                        alert(data.info);
                        header(data.url);
                    }
            );
        });

        $(".show-edit").click(function(){
            $(this).parent().next().toggleClass('hidden');
        });
    </script>
</block>